package view.panel;

import java.awt.FlowLayout;
import java.awt.event.MouseEvent;
import java.util.HashMap;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.MouseInputAdapter;

import manager.MenuManager;
import exception.NotFoundException;

public class MenuRightPanel extends JPanel {
	
	JTextField jfieldFromYear, jfieldFromMonth, jfieldFromDay,
	jfieldToYear, jfieldToMonth, jfieldToDay,
	jfieldMenu1,jfieldMenu2,jfieldMenu3, jfieldMenu4, jfieldMenu5;
	JButton jbtnSalesInfo;

	JLabel jlabelYear, jlabelMonth, jlabelDay,
	jlabelMenu1, jlabelMenu2, jlabelMenu3, jlabelMenu4, jlabelMenu5, jlabelGap;
	MenuManager menuManager;
	public SubMenuPanel subMenu;
	
	
	public MenuRightPanel() {
	
		menuManager = MenuManager.getInstance();
		setLayout(new FlowLayout());
		setSize(300,400);
		setVisible(true);
	
		jbtnSalesInfo = new JButton("매출정보");
				
		jlabelYear = new JLabel("년");
		jlabelMonth = new JLabel("월");
		jlabelDay = new JLabel("일");
		jlabelGap = new JLabel("~");
	
		jfieldFromYear = new JTextField(4);
		jfieldFromMonth = new JTextField(4);
		jfieldFromDay = new JTextField(4);
		jfieldToYear = new JTextField(4);
		jfieldToMonth = new JTextField(4);
		jfieldToDay = new JTextField(4);
		
	
		add(jbtnSalesInfo);
	
		add(jlabelYear);
		add(jlabelMonth);
		add(jlabelDay);
		
		add(jfieldFromYear);	
		add(jfieldFromMonth);
		add(jfieldFromDay);
		
		add(jlabelGap);
		
		add(jfieldToYear);
		add(jfieldToMonth);		
		add(jfieldToDay);
		
		subMenu = new SubMenuPanel();
		
		add(subMenu);
		
		jbtnSalesInfo.addMouseListener(new MouseInputAdapter() {
			
			@Override
			public void mouseClicked(MouseEvent e) {
				MenuManager.getInstance().analzeMenu();
			}
			
		});
		
	}

}